// 表格列
import tagRender from '@/components/aggridCellRenDerer/tagRender.vue'

let tableColumns: any = [
    {
        headerCheckboxSelection: true,
        checkboxSelection: true,
        width: 60,
        showDisabledCheckboxes: false,
        pinned: 'left',
    },
    {
        headerName: '借用单号',
        field: 'needCode',
        width: 200,
    },
    {
        headerName: '借出公司',
        field: 'companyName',
        width: 200,
    },
    {
        headerName: '借出部门',
        field: 'departmentName',
        width: 200,
    },
    {
        headerName: '借用公司',
        field: 'borrowCompanyName',
        width: 200,
    },
    // {
    //     headerName: '借用部门',
    //     field: 'departmentName',
    //     width: 200,
    // },
    // {
    //     headerName: '借用人',
    //     field: 'needPerson',
    //     width: 200,
    // },
    // {
    //     headerName: '所借机台',
    //     field: 'materialName',
    //     width: 200,
    // },
    {
        headerName: '借用时间',
        field: 'needTime',
        width: 200,
    },
    // {
    //     headerName: '何时归还',
    //     field: 'returnsTime',
    //     width: 200,
    // },
    // {
    //     headerName: '借用期',
    //     field: 'borrowNumer',
    //     width: 200,
    // },
    // {
    //     headerName: '借用期时间',
    //     field: 'borrowTime',
    //     width: 200,
    // },
    {
        headerName: '建立人',
        field: 'createName',
        width: 180,
    },
    {
        headerName: '建立时间',
        field: 'createTime',
        width: 180,
    },
    {
        headerName: '修改人',
        field: 'updateName',
        width: 180,
    },
    {
        headerName: '修改时间',
        field: 'updateTime',
        width: 180,
    },
    {
        headerName: '审核状态',
        field: 'auditState',
        width: 200,
        cellRenderer: tagRender,
        cellRendererParams: {
            styleClass: (params: any) => {
                return params.auditState == 0
                    ? 'warning'
                    : params.auditState == 1
                        ? 'success'
                        : params.auditState == 2
                            ? 'info'
                            : ''
            },
            text: (params: any) => {
                return params.auditState == 0
                    ? '待审核'
                    : params.auditState == 1
                        ? '审核通过'
                        : params.auditState == 2
                            ? '审核驳回'
                            : ''
            },
            eltagSize: 0,
        },
    },
    {
        headerName: '确认状态',
        field: 'affirmState',
        width: 190,
        cellRenderer: (params: any) => {
            if (params.affirmState) {
                return tagRender
            } else {
                return null
            }
        },
        cellRendererParams: {
            styleClass: (params: any) => {
                return params.affirmState == 0
                    ? 'warning'
                    : params.affirmState == 1
                        ? 'success'
                        : ''
            },
            text: (params: any) => {
                return params.affirmState == 0
                    ? '未确认'
                    : params.affirmState == 1
                        ? '已确认'
                        : ''
            },
            eltagSize: 0,
        },
    },
    {
        headerName: '归还状态',
        field: 'giveState',
        width: 189,
        cellRenderer: (params: any) => {
            if (params.giveState) {
                return tagRender
            } else {
                return null
            }
        },
        cellRendererParams: {
            styleClass: (params: any) => {
                return params.giveState == 0
                    ? 'warning'
                    : params.giveState == 1
                        ? 'success'
                        : ''
            },
            text: (params: any) => {
                return params.giveState == 0
                    ? '未归还确认'
                    : params.giveState == 1
                        ? '已归还'
                        : ''
            },
            eltagSize: 0,
        },
    },
]
// 表格列
let tableColumns1: any = [
    {
        headerCheckboxSelection: true,
        checkboxSelection: true,
        width: 60,
        showDisabledCheckboxes: false,
        pinned: 'left',
    },
    {
        headerName: '借用单号',
        field: 'needCode',
        width: 200,
    },
    {
        headerName: '借出公司',
        field: 'companyName',
        width: 200,
    },
    {
        headerName: '借出部门',
        field: 'departmentName',
        width: 200,
    },
    {
        headerName: '借入公司',
        field: 'borrowCompanyName',
        width: 200,
    },
    // {
    //     headerName: '借用部门',
    //     field: 'departmentName',
    //     width: 200,
    // },
    // {
    //     headerName: '借用人',
    //     field: 'needPerson',
    //     width: 200,
    // },
    // {
    //     headerName: '所借机台',
    //     field: 'materialName',
    //     width: 200,
    // },
    {
        headerName: '借用时间',
        field: 'needTime',
        width: 200,
    },
    // {
    //     headerName: '何时归还',
    //     field: 'returnsTime',
    //     width: 200,
    // },
    // {
    //     headerName: '借用期',
    //     field: 'borrowNumer',
    //     width: 200,
    // },
    // {
    //     headerName: '借用期时间',
    //     field: 'borrowTime',
    //     width: 200,
    // },
    {
        headerName: '建立人',
        field: 'createName',
        width: 180,
    },
    {
        headerName: '建立时间',
        field: 'createTime',
        width: 180,
    },
    {
        headerName: '修改人',
        field: 'updateName',
        width: 180,
    },
    {
        headerName: '修改时间',
        field: 'updateTime',
        width: 180,
    },
    {
        headerName: '审核状态',
        field: 'auditState',
        width: 200,
        cellRenderer: tagRender,
        cellRendererParams: {
            styleClass: (params: any) => {
                return params.auditState == 0
                    ? 'warning'
                    : params.auditState == 1
                        ? 'success'
                        : params.auditState == 2
                            ? 'info'
                            : ''
            },
            text: (params: any) => {
                return params.auditState == 0
                    ? '待审核'
                    : params.auditState == 1
                        ? '审核通过'
                        : params.auditState == 2
                            ? '审核驳回'
                            : ''
            },
            eltagSize: 0,
        },
    },
    // {
    //     headerName: '确认状态',
    //     field: 'affirmState',
    //     width: 190,
    //     cellRenderer: tagRender,
    //     cellRendererParams: {
    //         styleClass: (params: any) => {
    //             return params.affirmState == 0
    //                 ? 'warning'
    //                 : params.affirmState == 1
    //                     ? 'success'
    //                     : ''
    //         },
    //         text: (params: any) => {
    //             return params.affirmState == 0
    //                 ? '未确认'
    //                 : params.affirmState == 1
    //                     ? '已确认'
    //                     : ''
    //         },
    //         eltagSize: 0,
    //     },
    // },
    // {
    //     headerName: '归还状态',
    //     field: 'giveState',
    //     width: 189,
    //     cellRenderer: tagRender,
    //     cellRendererParams: {
    //         styleClass: (params: any) => {
    //             return params.giveState == 0
    //                 ? 'warning'
    //                 : params.giveState == 1
    //                     ? 'success'
    //                     : ''
    //         },
    //         text: (params: any) => {
    //             return params.giveState == 0
    //                 ? '未归还确认'
    //                 : params.giveState == 1
    //                     ? '已归还'
    //                     : ''
    //         },
    //         eltagSize: 0,
    //     },
    // },
]
let tableColumns2: any = [
    {
        headerCheckboxSelection: true,
        checkboxSelection: true,
        width: 60,
        showDisabledCheckboxes: false,
        pinned: 'left',
    },
    {
        headerName: '公司',
        field: 'outFirm',
        width: 180,
    },
    {
        headerName: '部门',
        field: 'departmentName',
        width: 180,
    },
    {
        headerName: '类型',
        field: 'type',
        width: 180,
    },
    {
        headerName: '固定资产编号',
        field: 'numberId',
        width: 180,
    },
    {
        headerName: '物料大类',
        field: 'majorCategory',
        width: 180,
    },
    {
        headerName: '物料中类',
        field: 'middleCategory',
        width: 150,
    },
    {
        headerName: '物料小类',
        field: 'subCategory',
        width: 180,
    },
    {
        headerName: '物料编号',
        field: 'materialCode',
        width: 180,
    },
    {
        headerName: '物料名称',
        field: 'materialName',
        width: 180,
    },


    {
        headerName: '所属区域',
        field: 'district',
        width: 180,
    },
    {
        headerName: '位置号',
        field: 'floorDistrict',
        width: 180,
    },
    {
        headerName: '分摊年限',
        field: 'shareYears',
        width: 180,
    },
    {
        headerName: '分摊类型',
        field: 'shareType',
        width: 180,
    },
    {
        headerName: '入厂时间',
        field: 'joinFactoryTime',
        width: 180,
    },
    {
        headerName: '备注',
        field: 'remark',
        width: 180,
    },

]
let tableColumns4: any = [
    {
        headerCheckboxSelection: true,
        checkboxSelection: true,
        width: 60,
        showDisabledCheckboxes: false,
        pinned: 'left',
    },
    {
        headerName: '公司',
        field: 'companyName',
        width: 230,
    },
    {
        headerName: '物料编号',
        field: 'materialCode',
        width: 230,
    },
    {
        headerName: '物料名称',
        field: 'materialName',
        width: 230,
    },
    {
        headerName: '固定资产编号',
        field: 'numberId',
        width: 230,
    },
    {
        headerName: '物料小类',
        field: 'majorCategory',
        width: 230,
    },
    {
        headerName: '借入部门',
        field: 'borrowDepartmentName',
        width: 220,
    },
    {
        headerName: '使用人',
        field: 'usePerson',
        width: 220,
    },
    {
        headerName: '何时归还',
        field: 'scrapTime',
        width: 230,
    },
    {
        headerName: '借用期(天)',
        field: 'deprecitionTime',
        width: 230,
    },
    {
        headerName: '分摊类型',
        field: 'shareType',
        width: 230,
    },
]
export {
    tableColumns,
    tableColumns1,
    tableColumns2,
    tableColumns4,
}